<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  <html xmlns="http://www.w3.org/1999/xhtml">
		<head>
			<!-- template designed by Marco Von Ballmoos  -->
			<title>File Source for tuto6.php</title>
			<link rel="stylesheet" href="../media/stylesheet.css" />
											</head>
		<body>
						<h1>Source for file tuto6.php</h1>
<p>Documentation is available at <a href="../DomBase/_libsPub---FPDF---tutorial---tuto6.php.html">tuto6.php</a></p>
<div class="src-code">
<div class="src-code"><ol><li><div class="src-line"><a name="a1"></a><span class="src-php">&lt;?php</span></div></li>
<li><div class="src-line"><a name="a2"></a>require<span class="src-sym">(</span><span class="src-str">'../fpdf.php'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a3"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a4"></a><span class="src-key">class&nbsp;</span><a href="../DomBase/PDF.html">PDF</a>&nbsp;<span class="src-key">extends&nbsp;</span><a href="../DomBase/FPDF.html#methodFPDF">FPDF</a></div></li>
<li><div class="src-line"><a name="a5"></a><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a6"></a><span class="src-key">var&nbsp;</span><span class="src-var">$B</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a7"></a><span class="src-key">var&nbsp;</span><span class="src-var">$I</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a8"></a><span class="src-key">var&nbsp;</span><span class="src-var">$U</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a9"></a><span class="src-key">var&nbsp;</span><span class="src-var">$HREF</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a10"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a11"></a><span class="src-key">function&nbsp;</span><span class="src-id">PDF</span><span class="src-sym">(</span><span class="src-var">$orientation</span>=<span class="src-str">'P'</span><span class="src-sym">,</span><span class="src-var">$unit</span>=<span class="src-str">'mm'</span><span class="src-sym">,</span><span class="src-var">$format</span>=<span class="src-str">'A4'</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a12"></a><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a13"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//Call&nbsp;parent&nbsp;constructor</span></div></li>
<li><div class="src-line"><a name="a14"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../DomBase/FPDF.html#methodFPDF">FPDF</a><span class="src-sym">(</span><span class="src-var">$orientation</span><span class="src-sym">,</span><span class="src-var">$unit</span><span class="src-sym">,</span><span class="src-var">$format</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a15"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//Initialization</span></div></li>
<li><div class="src-line"><a name="a16"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">B</span>=<span class="src-num">0</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a17"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">I</span>=<span class="src-num">0</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a18"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">U</span>=<span class="src-num">0</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a19"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">HREF</span>=<span class="src-str">''</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a20"></a><span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a21"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a22"></a><span class="src-key">function&nbsp;</span><span class="src-id">WriteHTML</span><span class="src-sym">(</span><span class="src-var">$html</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a23"></a><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a24"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//HTML&nbsp;parser</span></div></li>
<li><div class="src-line"><a name="a25"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$html</span>=<a href="http://www.php.net/str_replace">str_replace</a><span class="src-sym">(</span><span class="src-str">&quot;\n&quot;</span><span class="src-sym">,</span><span class="src-str">'&nbsp;'</span><span class="src-sym">,</span><span class="src-var">$html</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a26"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$a</span>=<a href="http://www.php.net/preg_split">preg_split</a><span class="src-sym">(</span><span class="src-str">'/&lt;(.*)&gt;/U'</span><span class="src-sym">,</span><span class="src-var">$html</span><span class="src-sym">,</span>-<span class="src-num">1</span><span class="src-sym">,</span><span class="src-id">PREG_SPLIT_DELIM_CAPTURE</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a27"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">foreach</span><span class="src-sym">(</span><span class="src-var">$a&nbsp;</span><span class="src-key">as&nbsp;</span><span class="src-var">$i</span>=&gt;<span class="src-var">$e</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a28"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a29"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$i</span>%<span class="src-num">2</span>==<span class="src-num">0</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a30"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a31"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//Text</span></div></li>
<li><div class="src-line"><a name="a32"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">HREF</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a33"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">PutLink</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">HREF</span><span class="src-sym">,</span><span class="src-var">$e</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a34"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">else</span></div></li>
<li><div class="src-line"><a name="a35"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../DomBase/FPDF.html#methodWrite">Write</a><span class="src-sym">(</span><span class="src-num">5</span><span class="src-sym">,</span><span class="src-var">$e</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a36"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a37"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">else</span></div></li>
<li><div class="src-line"><a name="a38"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a39"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//Tag</span></div></li>
<li><div class="src-line"><a name="a40"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$e</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span>==<span class="src-str">'/'</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a41"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">CloseTag</span><span class="src-sym">(</span><a href="http://www.php.net/strtoupper">strtoupper</a><span class="src-sym">(</span><a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$e</span><span class="src-sym">,</span><span class="src-num">1</span><span class="src-sym">)))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a42"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">else</span></div></li>
<li><div class="src-line"><a name="a43"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a44"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//Extract&nbsp;attributes</span></div></li>
<li><div class="src-line"><a name="a45"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$a2</span>=<a href="http://www.php.net/explode">explode</a><span class="src-sym">(</span><span class="src-str">'&nbsp;'</span><span class="src-sym">,</span><span class="src-var">$e</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a46"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$tag</span>=<a href="http://www.php.net/strtoupper">strtoupper</a><span class="src-sym">(</span><a href="http://www.php.net/array_shift">array_shift</a><span class="src-sym">(</span><span class="src-var">$a2</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a47"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$attr</span>=<span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a48"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">foreach</span><span class="src-sym">(</span><span class="src-var">$a2&nbsp;</span><span class="src-key">as&nbsp;</span><span class="src-var">$v</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a49"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a50"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><a href="http://www.php.net/preg_match">preg_match</a><span class="src-sym">(</span><span class="src-str">'/([^=]*)=[&quot;\']?([^&quot;\']*)/'</span><span class="src-sym">,</span><span class="src-var">$v</span><span class="src-sym">,</span><span class="src-var">$a3</span><span class="src-sym">))</span></div></li>
<li><div class="src-line"><a name="a51"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$attr</span><span class="src-sym">[</span><a href="http://www.php.net/strtoupper">strtoupper</a><span class="src-sym">(</span><span class="src-var">$a3</span><span class="src-sym">[</span><span class="src-num">1</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">]</span>=<span class="src-var">$a3</span><span class="src-sym">[</span><span class="src-num">2</span><span class="src-sym">]</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a52"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a53"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">OpenTag</span><span class="src-sym">(</span><span class="src-var">$tag</span><span class="src-sym">,</span><span class="src-var">$attr</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a54"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a55"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a56"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a57"></a><span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a58"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a59"></a><span class="src-key">function&nbsp;</span><span class="src-id">OpenTag</span><span class="src-sym">(</span><span class="src-var">$tag</span><span class="src-sym">,</span><span class="src-var">$attr</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a60"></a><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a61"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//Opening&nbsp;tag</span></div></li>
<li><div class="src-line"><a name="a62"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$tag</span>==<span class="src-str">'B'&nbsp;</span>||&nbsp;<span class="src-var">$tag</span>==<span class="src-str">'I'&nbsp;</span>||&nbsp;<span class="src-var">$tag</span>==<span class="src-str">'U'</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a63"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">SetStyle</span><span class="src-sym">(</span><span class="src-var">$tag</span><span class="src-sym">,</span><span class="src-id">true</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a64"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$tag</span>==<span class="src-str">'A'</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a65"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">HREF</span>=<span class="src-var">$attr</span><span class="src-sym">[</span><span class="src-str">'HREF'</span><span class="src-sym">]</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a66"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$tag</span>==<span class="src-str">'BR'</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a67"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../DomBase/FPDF.html#methodLn">Ln</a><span class="src-sym">(</span><span class="src-num">5</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a68"></a><span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a69"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a70"></a><span class="src-key">function&nbsp;</span><span class="src-id">CloseTag</span><span class="src-sym">(</span><span class="src-var">$tag</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a71"></a><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a72"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//Closing&nbsp;tag</span></div></li>
<li><div class="src-line"><a name="a73"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$tag</span>==<span class="src-str">'B'&nbsp;</span>||&nbsp;<span class="src-var">$tag</span>==<span class="src-str">'I'&nbsp;</span>||&nbsp;<span class="src-var">$tag</span>==<span class="src-str">'U'</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a74"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">SetStyle</span><span class="src-sym">(</span><span class="src-var">$tag</span><span class="src-sym">,</span><span class="src-id">false</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a75"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$tag</span>==<span class="src-str">'A'</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a76"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">HREF</span>=<span class="src-str">''</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a77"></a><span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a78"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a79"></a><span class="src-key">function&nbsp;</span><span class="src-id">SetStyle</span><span class="src-sym">(</span><span class="src-var">$tag</span><span class="src-sym">,</span><span class="src-var">$enable</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a80"></a><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a81"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//Modify&nbsp;style&nbsp;and&nbsp;select&nbsp;corresponding&nbsp;font</span></div></li>
<li><div class="src-line"><a name="a82"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">$tag</span>+=<span class="src-sym">(</span><span class="src-var">$enable&nbsp;</span>?&nbsp;<span class="src-num">1&nbsp;</span>:&nbsp;-<span class="src-num">1</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a83"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$style</span>=<span class="src-str">''</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a84"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">foreach</span><span class="src-sym">(</span><span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'B'</span><span class="src-sym">,</span><span class="src-str">'I'</span><span class="src-sym">,</span><span class="src-str">'U'</span><span class="src-sym">)&nbsp;</span><span class="src-key">as&nbsp;</span><span class="src-var">$s</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a85"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a86"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">$s</span>&gt;<span class="src-num">0</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a87"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$style</span>.=<span class="src-var">$s</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a88"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a89"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../DomBase/FPDF.html#methodSetFont">SetFont</a><span class="src-sym">(</span><span class="src-str">''</span><span class="src-sym">,</span><span class="src-var">$style</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a90"></a><span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a91"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a92"></a><span class="src-key">function&nbsp;</span><span class="src-id">PutLink</span><span class="src-sym">(</span><span class="src-var">$URL</span><span class="src-sym">,</span><span class="src-var">$txt</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a93"></a><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a94"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//Put&nbsp;a&nbsp;hyperlink</span></div></li>
<li><div class="src-line"><a name="a95"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../DomBase/FPDF.html#methodSetTextColor">SetTextColor</a><span class="src-sym">(</span><span class="src-num">0</span><span class="src-sym">,</span><span class="src-num">0</span><span class="src-sym">,</span><span class="src-num">255</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a96"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">SetStyle</span><span class="src-sym">(</span><span class="src-str">'U'</span><span class="src-sym">,</span><span class="src-id">true</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a97"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../DomBase/FPDF.html#methodWrite">Write</a><span class="src-sym">(</span><span class="src-num">5</span><span class="src-sym">,</span><span class="src-var">$txt</span><span class="src-sym">,</span><span class="src-var">$URL</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a98"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">SetStyle</span><span class="src-sym">(</span><span class="src-str">'U'</span><span class="src-sym">,</span><span class="src-id">false</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a99"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../DomBase/FPDF.html#methodSetTextColor">SetTextColor</a><span class="src-sym">(</span><span class="src-num">0</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a100"></a><span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a101"></a><span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a102"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a103"></a><span class="src-var">$html</span>=<span class="src-str">'You&nbsp;can&nbsp;now&nbsp;easily&nbsp;print&nbsp;text&nbsp;mixing&nbsp;different&nbsp;styles:&nbsp;&lt;b&gt;bold&lt;/b&gt;,&nbsp;&lt;i&gt;italic&lt;/i&gt;,</span></div></li>
<li><div class="src-line"><a name="a104"></a><span class="src-str">&lt;u&gt;underlined&lt;/u&gt;,&nbsp;or&nbsp;&lt;b&gt;&lt;i&gt;&lt;u&gt;all&nbsp;at&nbsp;once&lt;/u&gt;&lt;/i&gt;&lt;/b&gt;!&lt;br&gt;&lt;br&gt;You&nbsp;can&nbsp;also&nbsp;insert&nbsp;links&nbsp;on</span></div></li>
<li><div class="src-line"><a name="a105"></a><span class="src-str">text,&nbsp;such&nbsp;as&nbsp;&lt;a&nbsp;href=&quot;http://www.fpdf.org&quot;&gt;www.fpdf.org&lt;/a&gt;,&nbsp;or&nbsp;on&nbsp;an&nbsp;image:&nbsp;click&nbsp;on&nbsp;the&nbsp;logo.'</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a106"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a107"></a><span class="src-var">$pdf</span>=<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../DomBase/PDF.html">PDF</a></span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a108"></a><span class="src-comm">//First&nbsp;page</span></div></li>
<li><div class="src-line"><a name="a109"></a><span class="src-var">$pdf</span><span class="src-sym">-&gt;</span><a href="../DomBase/FPDF.html#methodAddPage">AddPage</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a110"></a><span class="src-var">$pdf</span><span class="src-sym">-&gt;</span><a href="../DomBase/FPDF.html#methodSetFont">SetFont</a><span class="src-sym">(</span><span class="src-str">'Arial'</span><span class="src-sym">,</span><span class="src-str">''</span><span class="src-sym">,</span><span class="src-num">20</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a111"></a><span class="src-var">$pdf</span><span class="src-sym">-&gt;</span><a href="../DomBase/FPDF.html#methodWrite">Write</a><span class="src-sym">(</span><span class="src-num">5</span><span class="src-sym">,</span><span class="src-str">'To&nbsp;find&nbsp;out&nbsp;what\'s&nbsp;new&nbsp;in&nbsp;this&nbsp;tutorial,&nbsp;click&nbsp;'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a112"></a><span class="src-var">$pdf</span><span class="src-sym">-&gt;</span><a href="../DomBase/FPDF.html#methodSetFont">SetFont</a><span class="src-sym">(</span><span class="src-str">''</span><span class="src-sym">,</span><span class="src-str">'U'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a113"></a><span class="src-var">$link</span>=<span class="src-var">$pdf</span><span class="src-sym">-&gt;</span><a href="../DomBase/FPDF.html#methodAddLink">AddLink</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a114"></a><span class="src-var">$pdf</span><span class="src-sym">-&gt;</span><a href="../DomBase/FPDF.html#methodWrite">Write</a><span class="src-sym">(</span><span class="src-num">5</span><span class="src-sym">,</span><span class="src-str">'here'</span><span class="src-sym">,</span><span class="src-var">$link</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a115"></a><span class="src-var">$pdf</span><span class="src-sym">-&gt;</span><a href="../DomBase/FPDF.html#methodSetFont">SetFont</a><span class="src-sym">(</span><span class="src-str">''</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a116"></a><span class="src-comm">//Second&nbsp;page</span></div></li>
<li><div class="src-line"><a name="a117"></a><span class="src-var">$pdf</span><span class="src-sym">-&gt;</span><a href="../DomBase/FPDF.html#methodAddPage">AddPage</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a118"></a><span class="src-var">$pdf</span><span class="src-sym">-&gt;</span><a href="../DomBase/FPDF.html#methodSetLink">SetLink</a><span class="src-sym">(</span><span class="src-var">$link</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a119"></a><span class="src-var">$pdf</span><span class="src-sym">-&gt;</span><a href="../DomBase/FPDF.html#methodImage">Image</a><span class="src-sym">(</span><span class="src-str">'logo.png'</span><span class="src-sym">,</span><span class="src-num">10</span><span class="src-sym">,</span><span class="src-num">12</span><span class="src-sym">,</span><span class="src-num">30</span><span class="src-sym">,</span><span class="src-num">0</span><span class="src-sym">,</span><span class="src-str">''</span><span class="src-sym">,</span><span class="src-str">'http://www.fpdf.org'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a120"></a><span class="src-var">$pdf</span><span class="src-sym">-&gt;</span><a href="../DomBase/FPDF.html#methodSetLeftMargin">SetLeftMargin</a><span class="src-sym">(</span><span class="src-num">45</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a121"></a><span class="src-var">$pdf</span><span class="src-sym">-&gt;</span><a href="../DomBase/FPDF.html#methodSetFontSize">SetFontSize</a><span class="src-sym">(</span><span class="src-num">14</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a122"></a><span class="src-var">$pdf</span><span class="src-sym">-&gt;</span><span class="src-id">WriteHTML</span><span class="src-sym">(</span><span class="src-var">$html</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a123"></a><span class="src-var">$pdf</span><span class="src-sym">-&gt;</span><a href="../DomBase/FPDF.html#methodOutput">Output</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a124"></a><span class="src-php">?&gt;</span></div></li>
</ol></div>
</div>
	<p class="notes" id="credit">
		Documentation generated on Fri, 24 Sep 2010 21:15:33 +0000 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.4.1</a>
	</p>
	</body>
</html>